// 导航栏左边分类
 var contentlefts = $("#content-left ul li");
 for(var i = 0 ;i < contentlefts.length;i++){
	 contentlefts[i].onmouseover = function (){
		 this.style.backgroundColor = "#ff6600";
	 }
	 contentlefts[i].onmouseout = function (){
		 this.style.backgroundColor = "";
	 }
 }
 //轮播图
var time = 1;
var timer = setInterval(function(){
	++time;
	if(time == 4){
		time = 1;
	}
	$("#content-right img").fadeOut(1000,function(){
		$("#content-right img").attr("src","../../static/img/"+time+".png");
		$("#content-right img").fadeIn(1000);
	});
},5000);
//按钮
$("#left").mouseenter(function (){
	$("#left").css("background-color","rgba(144, 140, 140, 0.6)");
	clearTimeout(timer);
});
$("#left").click(function (){
	if(time >1){
		$("#content-right img").fadeOut(1000,function(){
			--time;
			$("#content-right img").attr("src","../../static/img/"+time+".png");
			$("#content-right img").fadeIn(1000);
		});
	}
});
$("#left").mouseleave(function(){
	$("#left").css("background-color","");
	timer = setInterval(function(){
		++time;
		if(time == 4){
			time = 1;
		}
		$("#content-right img").fadeOut(1000,function(){
			$("#content-right img").attr("src","../../static/img/"+time+".png");
			$("#content-right img").fadeIn(1000);
		});
	},5000);
});
$("#right").mouseenter(function (){
	$("#right").css("background-color","rgba(144, 140, 140, 0.6)");
	clearTimeout(timer);
});
$("#right").click(function (){
	if(time < 3){
		$("#content-right img").fadeOut(1000,function(){
			++time;
			$("#content-right img").attr("src","../../static/img/"+time+".png");
			$("#content-right img").fadeIn(1000);
		});
	}
});
$("#right").mouseleave(function(){
	$("#right").css("background-color","");
	timer = setInterval(function(){
		++time;
		if(time == 4){
			time = 1;
		}
		$("#content-right img").fadeOut(1000,function(){
			$("#content-right img").attr("src","../../static/img/"+time+".png");
			$("#content-right img").fadeIn(1000);
		});
	},5000);
});
//图片获取焦点消除定时器
$("#content-right img").mouseenter(function(){
	clearTimeout(timer);
});
//重启定时器
$("#content-right img").mouseleave(function(){
	timer = setInterval(function(){
		++time;
		if(time == 4){
			time = 1;
		}
		$("#content-right img").fadeOut(1000,function(){
			$("#content-right img").attr("src","../../static/img/"+time+".png");
			$("#content-right img").fadeIn(1000);
		});
	},5000);
});

